package cn.iocoder.yudao.module.infrastructure.sms.api;

import cn.iocoder.yudao.module.api.infrastructure.sms.SmsSendApi;
import cn.iocoder.yudao.module.api.infrastructure.sms.dto.send.SmsSendSingleToUserReqDTO;
import cn.iocoder.yudao.module.infrastructure.sms.service.SmsSendService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;

/**
 * 短信发送 API 接口
 *
 * @author 芋道源码
 */
@Service
@Validated
public class SmsSendApiImpl implements SmsSendApi {

    @Resource
    private SmsSendService smsSendService;

    @Override
    public Long sendSingleSmsToAdmin(SmsSendSingleToUserReqDTO dto) {
        return smsSendService.sendSingleSmsToAdmin(dto.getMobile(), dto.getUserId(),
                dto.getTemplateCode(), dto.getTemplateParams());
    }

    @Override
    public Long sendSingleSmsToMember(SmsSendSingleToUserReqDTO dto) {
        return smsSendService.sendSingleSmsToMember(dto.getMobile(), dto.getUserId(),
                dto.getTemplateCode(), dto.getTemplateParams());
    }

}
